package com.admin.service;

import com.admin.bean.ShieldWord;
import com.admin.dbdao.ShieldWordDao;
import com.data.util.CheckDataUtils;
import com.data.util.DatabaseIdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * 屏蔽词管理
 *
 * @author:HingLo
 * @create 2017-09-12 10:53
 **/
@Service
public class ShieldWordService {
    @Autowired
    private ShieldWordDao shieldWordDao;

    public ShieldWord findShieldWordService() {
        return (ShieldWord) shieldWordDao.findShieldWordDao();
    }

    public boolean changeShieldWordService(ShieldWord shieldWord) {
        if (!CheckDataUtils.stringUtilsID(shieldWord.getId())) {
            shieldWord.setId(DatabaseIdUtils.getDataIdOne());
        }
        shieldWord.setCtime(new Date());
        return shieldWordDao.changeShieldWordDao(shieldWord);
    }


}
